{template "content","header"}



<!-- eee-->
<style type="text/css">
    .fe_t dl img {
        max-width: 260px;
        max-height: 260px;
        scale: expression( (this.offsetWidth > this.offsetHeight)?(this.style.width=this.offsetWidth >=260 ? "260px": "auto"): (this.style.height=this.offsetHeight >=260 ? "260px": "auto"));
        display: inline !important;
    }
    
    .fe_t dl {
        display: block;
        width: 260px;
        float: left;
    }
</style>
<div class="fe_t">
    <!--<div class="fe_t">-->
    {pc:content action="lists" catid="26" moreinfo="1" order="id DESC" num="20"} {loop $data $key $val}
    <dl>
        <dt>
        	<h3><i>KRW:</i><span>{$val['price']}</span></h3>
        	<h4><i>NO:</i><span>{$val['title']}</span></h4>
        </dt>
        <dd style="margin:0px;padding:0px; vertical-align:middle;">
            <a href="{$val['url']}" target="_blank"><img src="{$val['thumb']}" /></a>
        </dd>
    </dl>
    {/loop} {/pc}

    <!--</div>-->
    <div id="loading" style="display:none;"><img alt="Loading..." src="{IMG_PATH}loadingbar1.gif">
        <div></div>
    </div>
</div>

<input type="hidden" id="daoh" value="">

<script type="text/javascript" language="javascript">
    var paixu = {};

    <?php
	if(!empty($_GET['search'])){
		?>
    paixu.search = "<?=$_GET['search'];?>";
    <?php
	}	
?>

    var $ci = 0;
    var curr_cid = 26;
    $(function() {
        $(".paixu-item").each(function() {
            $(this).click(function() {

                var key = $(this).attr('data-key');
                var val = $(this).attr('data-val');
                paixu.key = key;
                paixu.val = val;
                if (curr_cid) {
                    $(this).addClass('paixu-item-height').siblings('.paixu-item').removeClass('paixu-item-height')
                    cli(curr_cid);
                }

            })
        })
        $("#fen_26 a").click()


    })

    function cli(id) {
        curr_cid = id;

        $ci = 0;

        $('#daoh').val('');
        $('#sousuo').val('');
        $('#hidden').val(id);
        $('.fe_t').html('');
        paixu.catid = id;
        if (paixu.search) {
            delete paixu.catid
        }
        delete paixu.ci
            //delete paixu.search
        console.info(paixu)
        $.post(
            "index.php?m=content&c=index&a=liebiao",
            paixu,
            function(data) {
                $str = '';
                $info = data.res;
                for ($i = 0; $i < data.num; $i++) {
                    $str += "<dl><dt><h3><i>KRW:</i><span>" + $info[$i]['price'] + "</span></h3><h4><i>NO:</i><span>" + $info[$i]['title'] + "</span></h4></dt><dd style='margin:0px;padding:0px; vertical-align:middle;'><a href='" + $info[$i]['url'] + "' target='_blank'><img src='" + $info[$i]['thumb'] + "'  /></a></dd></dl>";
                }
                delete paixu.search
                $('.fe_t').append($str);
            }, "json"
        );
    }
    $('#search').click(function() {
        $ci = 0;
        $text = $('#sousuo').val();
        $('#daoh').val('');
        if ($text == '') {
            alert('搜索内容为空，请重新输入！');
            return false;
        }
        paixu.search = $text;
        $('.fe_t').html('');
        if (paixu.search) {
            delete paixu.catid;
        }
        $.post("index.php?m=content&c=index&a=liebiao", paixu, function(data) {
            $str = '';
            $info = data.res;
            for ($i = 0; $i < data.num; $i++) {
                $str += "<dl><dt><h3><i>KRW:</i><span>" + $info[$i]['price'] + "</span></h3><h4><i>NO:</i><span>" + $info[$i]['title'] + "</span></h4></dt><dd style='margin:0px;padding:0px; vertical-align:middle;'><a href='" + $info[$i]['url'] + "' target='_blank'><img src='" + $info[$i]['thumb'] + "'  /></a></dd></dl>";
            }
            $('.fe_t').append($str);
        }, "json");
    });
    var timmerShowPic = '';
    $(window).scroll(function() {
        if (timmerShowPic != '') {
            clearTimeout(timmerShowPic);
        }
        var height = document.documentElement.scrollTop || document.body.scrollTop; //当前高度
        var sheight = document.documentElement.clientHeight; //scroll高度
        var allheight = document.body.clientHeight; //总高度
        var cha = allheight - sheight;
        timmerShowPic = setTimeout(function() {
            var imgHiden = $('[data-src]');
            imgHiden.each(function() {
                if ($(this).offset().top + $(this).parent().parent().height() > $(window).scrollTop() && ($(this).offset().top - $(window).scrollTop() < $(window).height())) {
                    var imgSrc = $(this).attr('data-src');
                    $(this).attr('src', imgSrc).removeAttr('data-src');
                }
            });
        }, 200);
        if ((cha - height) < 370) {

            $text = $('#sousuo').val();
            $cat = $('#hidden').val();
            $daoh = $('#daoh').val();
            if ($daoh == 'daoh') {
                return false;
            } else {
                $ci++;
            }
            paixu.search = $text;
            paixu.catid = $cat;
            paixu.ci = $ci;
            $("#loading").css({
                display: 'block'
            });
            $.post("index.php?m=content&c=index&a=liebiao", paixu, function(data) {
                $str = '';
                $info = data.res;
                for ($i = 0; $i < data.num; $i++) {
                    $str += "<dl><dt><h3><i>KRW:</i><span>" + $info[$i]['price'] + "</span></h3><h4><i>NO:</i><span>" + $info[$i]['title'] + "</span></h4></dt><dd style='margin:0px;padding:0px; vertical-align:middle;'><a href='" + $info[$i]['url'] + "' target='_blank'><img data-src='" + $info[$i]['thumb'] + "'  /></a></dd></dl>";
                }
                $('.fe_t').append($str);
                $("#loading").css({
                    display: 'none'
                });
            }, "json");

        }

    });
    $(document).keydown(function(event) {
        if (event.keyCode == 13) {
            $ci = 0;
            $('#daoh').val('');
            $text = $('#sousuo').val();
            if ($text == '') {
                alert('搜索内容为空，请重新输入！');
                return false;
            }
            $('.fe_t').html('');
            paixu.search = $text;
            $.post("index.php?m=content&c=index&a=liebiao", paixu, function(data) {
                $str = '';
                $info = data.res;
                /*for($i=0;$i<data.num;$i++){
                	$str += "<dl><dt><h3><i>KRW:</i><span>"+$info[$i]['price']+"</span></h3><h4><i>NO:</i><span>"+$info[$i]['title']+"</span></h4></dt><dd style='margin:0px;padding:0px; vertical-align:middle;'><a href='"+$info[$i]['url']+"' target='_blank'><img src='"+$info[$i]['thumb']+"'  /></a></dd></dl>";
                }	*/
                for ($i = 0; $i < data.num; $i++) {
                    $str += "<dl><dt><h3><i>KRW:</i><span>" + $info[$i]['price'] + "</span></h3><h4><i>NO:</i><span>" + $info[$i]['title'] + "</span></h4></dt><dd style='margin:0px;padding:0px; vertical-align:middle;'><a href='" + $info[$i]['url'] + "' target='_blank'><img src='" + $info[$i]['thumb'] + "'  /></a></dd></dl>";
                }
                $('.fe_t').append($str);
            }, "json");
        }
    });
    $('#dbright').click(function() {
        $('#daoh').val('daoh');
        $('.fe_t').html('');
        $str = "<iframe width='1070' height='auto' id='iframepage' src='index.php?m=content&c=index&a=daoh' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' > </iframe>";
        $('.fe_t').append($str);
        return false;
    });
</script>
<script>
	function getPv(){
        var href=window.location.href;
        href=encodeURI(href)
        console.log(href)
		$.get('?m=content&c=index&a=pv&href='+href,{},function(data){
			
		},'json')
	}
	setTimeout('getPv()',3000);
</script>
<script>
	$(function(){
		//alert()
		
	})
</script>
</body>

</html>